<html>
<head><meta charset="utf-8"><title>issue #54401 - HRTB in impls unsoundness · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html">issue #54401 - HRTB in impls unsoundness</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="134609632"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609632" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609632">(Sep 25 2018 at 16:31)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <br>
So I read your comments about <a href="https://github.com/rust-lang/rust/issues/54302" target="_blank" title="https://github.com/rust-lang/rust/issues/54302">https://github.com/rust-lang/rust/issues/54302</a> and <a href="https://github.com/rust-lang/rust/issues/54302" target="_blank" title="https://github.com/rust-lang/rust/issues/54302">https://github.com/rust-lang/rust/issues/54302</a></p>



<a name="134609645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609645">(Sep 25 2018 at 16:31)</a>:</h4>
<p>I'm trying to think whether we should do a perf run</p>



<a name="134609777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609777">(Sep 25 2018 at 16:33)</a>:</h4>
<p>seems fine to do so</p>



<a name="134609844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609844">(Sep 25 2018 at 16:34)</a>:</h4>
<p>yea</p>



<a name="134609867"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609867" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609867">(Sep 25 2018 at 16:34)</a>:</h4>
<p>I'm not sure how hard will be doing evaluation "correctly"</p>



<a name="134609891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609891">(Sep 25 2018 at 16:35)</a>:</h4>
<p>given that higher-ranked lifetimes can't come with where-clauses on them</p>



<a name="134609972"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609972" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609972">(Sep 25 2018 at 16:36)</a>:</h4>
<blockquote>
<p>I'm not sure how hard will be doing evaluation "correctly"</p>
</blockquote>
<p>I'm not sure what you mean by correctly here</p>



<a name="134609976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609976">(Sep 25 2018 at 16:36)</a>:</h4>
<p>I mean, handling lifetimes in trait evaluations</p>



<a name="134609983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609983">(Sep 25 2018 at 16:36)</a>:</h4>
<p>because you only need to handle escaping regions</p>



<a name="134609991"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609991" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609991">(Sep 25 2018 at 16:36)</a>:</h4>
<p>so you know that <code>'a: 'b</code> can only hold if either <code>'a = 'b</code> or <code>'a</code> is an infer variable</p>



<a name="134609992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609992">(Sep 25 2018 at 16:36)</a>:</h4>
<p>(re: HR lifetimes, my assumption was that we would use an "implied bounds" sort of setup, for backwards compatibility)</p>



<a name="134609997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134609997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134609997">(Sep 25 2018 at 16:37)</a>:</h4>
<p>(but that's a bit further down the line)</p>



<a name="134610001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610001">(Sep 25 2018 at 16:37)</a>:</h4>
<p>I don't think we do implied bounds today</p>



<a name="134610011"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610011" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610011">(Sep 25 2018 at 16:37)</a>:</h4>
<p>but we also don't check WF today</p>



<a name="134610016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610016">(Sep 25 2018 at 16:37)</a>:</h4>
<p>so it equals out</p>



<a name="134610022"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610022" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610022">(Sep 25 2018 at 16:37)</a>:</h4>
<p>right now we just ignore things involving HR regions until you actually instantiate them</p>



<a name="134610027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610027">(Sep 25 2018 at 16:37)</a>:</h4>
<p>right</p>



<a name="134610032"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610032" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610032">(Sep 25 2018 at 16:37)</a>:</h4>
<p>I mean, of course you want implied bounds for WF</p>



<a name="134610044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610044">(Sep 25 2018 at 16:37)</a>:</h4>
<p>*for non-WF</p>



<a name="134610097"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610097" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610097">(Sep 25 2018 at 16:38)</a>:</h4>
<p>I mean, you definitely want some sort of implied bounds for WF itself</p>



<a name="134610131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610131">(Sep 25 2018 at 16:38)</a>:</h4>
<p>but today a <code>for&lt;'a&gt; Foo&lt;'a&gt;: Bar</code> means <code>forall&lt;'a&gt; Implemented(Foo&lt;'a&gt;: Bar)</code> modulo bugs</p>



<a name="134610142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610142">(Sep 25 2018 at 16:38)</a>:</h4>
<p>with no extra predicates in the environment</p>



<a name="134610163"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610163" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610163">(Sep 25 2018 at 16:39)</a>:</h4>
<p>(in a where clause)</p>



<a name="134610249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610249">(Sep 25 2018 at 16:40)</a>:</h4>
<p>I was just looking at roughly this topic in the context of the universe PR, realizing that we have to refactor how the region-obligations are being returned, in particular to handle the case where you are returning a relation to a placeholder region in some fresh universe</p>



<a name="134610268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610268">(Sep 25 2018 at 16:40)</a>:</h4>
<p>in the "older style", where the param-env carried the universe, I was capturing the param-env with the region obligations, and that was ok</p>



<a name="134610303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610303">(Sep 25 2018 at 16:41)</a>:</h4>
<p>but in the newer style, where the "current universe" lives in the inference context and we try to normalize, that doesn't work as well, you need to map to fresh universes</p>



<a name="134610334"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610334" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610334">(Sep 25 2018 at 16:41)</a>:</h4>
<p>returning a relation?</p>



<a name="134610431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610431">(Sep 25 2018 at 16:42)</a>:</h4>
<p>i.e., when you do trait solving, you get back a series of region constraints you have to solve; these may involve placeholders in new universes, in the case of <code>for&lt;..&gt;</code> binders</p>



<a name="134610452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610452">(Sep 25 2018 at 16:43)</a>:</h4>
<p>placeholder being the term I am trying to adopt in lieu of 'skolemized', given that that term is confusing and used in different ways by different folks</p>



<a name="134610491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610491">(Sep 25 2018 at 16:43)</a>:</h4>
<p>don't you solve constraints from other universes eagerly?</p>



<a name="134610496"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610496" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610496">(Sep 25 2018 at 16:43)</a>:</h4>
<p>not for regions, no</p>



<a name="134610543"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610543" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610543">(Sep 25 2018 at 16:44)</a>:</h4>
<p>at least i'm hoping we can avoid it</p>



<a name="134610565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610565">(Sep 25 2018 at 16:44)</a>:</h4>
<p>though it might make some things easier, and might plausibly be needed for backwards compat</p>



<a name="134610607"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610607" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610607">(Sep 25 2018 at 16:45)</a>:</h4>
<p>so that means that Eval(String: DeserializeOwned) is a compilation error rather than false?</p>



<a name="134610668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610668">(Sep 25 2018 at 16:46)</a>:</h4>
<p>if we avoided solving eagerly, then it would be a "ok" result but with region constraints that give an error when you try to solve them</p>



<a name="134610721"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610721" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610721">(Sep 25 2018 at 16:46)</a>:</h4>
<p>this has a uniformity that appeals to me; I'm trying to think what my other reason was</p>



<a name="134610724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610724">(Sep 25 2018 at 16:46)</a>:</h4>
<p>yea, exactly what I'll call a "compilation error rather than false"</p>



<a name="134610757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610757">(Sep 25 2018 at 16:46)</a>:</h4>
<p>because I suppose it means that <code>!(String: DeserializeOwned)</code> is not Ok either?</p>



<a name="134610767"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610767" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610767">(Sep 25 2018 at 16:47)</a>:</h4>
<p>in any modality?</p>



<a name="134610789"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610789" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610789">(Sep 25 2018 at 16:47)</a>:</h4>
<p>sounds correct</p>



<a name="134610874"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610874" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610874">(Sep 25 2018 at 16:48)</a>:</h4>
<p>btw, my <code>RefFoo</code> example was supposed to just have no regions in its problem predicate</p>



<a name="134610891"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610891" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610891">(Sep 25 2018 at 16:48)</a>:</h4>
<p>so that you can't talk about any funkiness with that region</p>



<a name="134610928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610928">(Sep 25 2018 at 16:49)</a>:</h4>
<p>I just find that resolving a predicate with no  inference variables returning things that do have inference variables to be confusing</p>



<a name="134610933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610933">(Sep 25 2018 at 16:49)</a>:</h4>
<p>I think one of my other concerns was that if we had to solve region constraints eagerly — well, that's complex, because you can have things like <code>for&lt;'a&gt; { if ('a: 'b, 'b: 'a) { 'a = 'b } }</code> and that should be true. So, at minimum, the setup that we use now for propagating universes wouldn't be right. (I'd like to try and implement a more careful solver for these kinds of scenarios, though, but I've not thought particularly hard about it.)</p>



<a name="134610966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610966">(Sep 25 2018 at 16:49)</a>:</h4>
<p>I remember that we didn't want to have negative reasoning on region equality</p>



<a name="134610986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134610986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134610986">(Sep 25 2018 at 16:49)</a>:</h4>
<p>because of it being a back-compat/"stability" hazard</p>



<a name="134611044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611044">(Sep 25 2018 at 16:50)</a>:</h4>
<blockquote>
<p>btw, my <code>RefFoo</code> example was supposed to just have no regions in its problem predicate</p>
</blockquote>
<p>you mean this example?</p>
<div class="codehilite"><pre><span></span><span class="k">trait</span><span class="w"> </span><span class="n">RefFoo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">ref_foo</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nb">&#39;static</span><span class="w"> </span><span class="kt">u32</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="n">RefFoo</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">T</span><span class="w"> </span><span class="k">where</span><span class="w"> </span><span class="k">for</span><span class="o">&lt;</span><span class="na">&#39;a</span><span class="o">&gt;</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;a</span><span class="w"> </span><span class="n">T</span>: <span class="nc">Foo</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">ref_foo</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nb">&#39;static</span><span class="w"> </span><span class="kt">u32</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">foo</span><span class="p">()</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>


<p>how would the predicate be changed then?</p>



<a name="134611060"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611060" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611060">(Sep 25 2018 at 16:50)</a>:</h4>
<p>I mean, in my example the "problem predicate" is &lt;u32 as RefFoo&gt;</p>



<a name="134611079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611079">(Sep 25 2018 at 16:50)</a>:</h4>
<p>which contains no lifetimes, but with "lazy outlives normalization" its normalization will suddenly contain inference variables</p>



<a name="134611125"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611125" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611125">(Sep 25 2018 at 16:51)</a>:</h4>
<p>my mental model is that if your type is 'static, then you are in classical logic land and all trait questions have clear yes/no answers</p>



<a name="134611128"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611128" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611128">(Sep 25 2018 at 16:51)</a>:</h4>
<blockquote>
<p>I just find that resolving a predicate with no  inference variables returning things that do have inference variables to be confusing</p>
</blockquote>
<p>when you say "that do have inference variables", you are referring to the "placeholders" we have to create?</p>
<p><del>e.g., when we solve <code>for&lt;'a&gt; 'a: 'static</code>, this gets translated to a <code>'!1: 'static</code> sort of thing (where <code>!1</code> is a placeholder)</del> this was confused</p>



<a name="134611201"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611201" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611201">(Sep 25 2018 at 16:52)</a>:</h4>
<p>oh maybe I see what you mean, sorry</p>



<a name="134611208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611208">(Sep 25 2018 at 16:52)</a>:</h4>
<p>you're saying, the impl that we apply?</p>



<a name="134611232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611232">(Sep 25 2018 at 16:53)</a>:</h4>
<blockquote>
<p>when you say "that do have inference variables", you are referring to the "placeholders" we have to create?</p>
</blockquote>
<p>can't you get constraints that have existentials in them?</p>



<a name="134611263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611263">(Sep 25 2018 at 16:53)</a>:</h4>
<p>I'm trying to think if you can</p>



<a name="134611282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611282">(Sep 25 2018 at 16:53)</a>:</h4>
<p>I think that RFC 447 won't let you</p>



<a name="134611284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611284">(Sep 25 2018 at 16:53)</a>:</h4>
<p>I think the answer is technically yes, but they would be constrained to be equal to placeholders</p>



<a name="134611331"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611331" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611331">(Sep 25 2018 at 16:54)</a>:</h4>
<p>because it exactly forces things to equal to placeholders</p>



<a name="134611341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611341">(Sep 25 2018 at 16:54)</a>:</h4>
<p>*all inference variables</p>



<a name="134611343"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611343" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611343">(Sep 25 2018 at 16:54)</a>:</h4>
<p>(and hence could conceivably be normalized)</p>



<a name="134611374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611374">(Sep 25 2018 at 16:54)</a>:</h4>
<p>chalk <em>does</em> handle unification on inference variables, in part to simplify the output</p>



<a name="134611403"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611403" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611403">(Sep 25 2018 at 16:55)</a>:</h4>
<p>I think that in the current rustc, with no where-clauses on higher-universe placeholders</p>



<a name="134611422"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611422" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611422">(Sep 25 2018 at 16:55)</a>:</h4>
<p>you never need to <em>return</em> placeholders</p>



<a name="134611426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611426">(Sep 25 2018 at 16:55)</a>:</h4>
<p>e.g. in this example, you would have <code>for&lt;'a&gt; &amp;'a T: Foo</code>, this creates a placeholder <code>!1</code> and then applies the impl. Applying the impl creates an existential <code>?0</code> that is equated with <code>!1</code>.</p>



<a name="134611448"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611448" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611448">(Sep 25 2018 at 16:55)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yea exactly, and then you equate <code>?0 = !1</code>, and RFC 447 means you can always do it</p>



<a name="134611450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611450">(Sep 25 2018 at 16:55)</a>:</h4>
<blockquote>
<p>you never need to <em>return</em> placeholders</p>
</blockquote>
<p>well wouldn't that require us to eagerly solve the constriants?</p>



<a name="134611455"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611455" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611455">(Sep 25 2018 at 16:55)</a>:</h4>
<p>yea, exactly</p>



<a name="134611507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611507">(Sep 25 2018 at 16:56)</a>:</h4>
<p>I don't think that with the current trait checker there are any obstructions to eagerly solving constraints</p>



<a name="134611508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611508">(Sep 25 2018 at 16:56)</a>:</h4>
<p>ok</p>



<a name="134611513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611513">(Sep 25 2018 at 16:56)</a>:</h4>
<p><em>because</em> there are no where-clauses</p>



<a name="134611518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611518">(Sep 25 2018 at 16:56)</a>:</h4>
<p>sounds correct</p>



<a name="134611525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611525">(Sep 25 2018 at 16:56)</a>:</h4>
<p>(but we do want where clauses to close the soundness hole around contravariance)</p>



<a name="134611535"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611535" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611535">(Sep 25 2018 at 16:57)</a>:</h4>
<p>will they be where clauses around HRTBs?</p>



<a name="134611556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611556">(Sep 25 2018 at 16:57)</a>:</h4>
<p>I guess those could be separated</p>



<a name="134611565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611565">(Sep 25 2018 at 16:57)</a>:</h4>
<p>I hadn't considered doing so</p>



<a name="134611571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611571">(Sep 25 2018 at 16:57)</a>:</h4>
<p>I mean, obviously we <em>do</em> have where clauses today, e.g. in trait impls</p>



<a name="134611636"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611636" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611636">(Sep 25 2018 at 16:58)</a>:</h4>
<p>right but not on HRTB's</p>



<a name="134611649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611649">(Sep 25 2018 at 16:58)</a>:</h4>
<p>which I <em>think</em> is the relevant thing?</p>



<a name="134611661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611661">(Sep 25 2018 at 16:58)</a>:</h4>
<p>well</p>



<a name="134611668"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611668" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611668">(Sep 25 2018 at 16:59)</a>:</h4>
<p>yea. I think that having HRTBs with where-clauses is a strictly "needs research" thing</p>



<a name="134611690"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611690" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611690">(Sep 25 2018 at 16:59)</a>:</h4>
<p>(obviously the regions on impls can play a "placeholder" role, so there's a sort of asymmetry, I guess that's the point you were making?)</p>



<a name="134611704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611704">(Sep 25 2018 at 16:59)</a>:</h4>
<p>(e.g. when WF checking the impl or something)</p>



<a name="134611714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611714">(Sep 25 2018 at 16:59)</a>:</h4>
<blockquote>
<p>I guess that's the point you were making?</p>
</blockquote>



<a name="134611716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611716">(Sep 25 2018 at 16:59)</a>:</h4>
<p>when?</p>



<a name="134611781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611781">(Sep 25 2018 at 17:00)</a>:</h4>
<p>"higher-universe placeholders" - sure</p>



<a name="134611787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611787">(Sep 25 2018 at 17:00)</a>:</h4>
<p>only the "0 universe" can have where-clauses in it ATM</p>



<a name="134611966"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134611966" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134611966">(Sep 25 2018 at 17:03)</a>:</h4>
<p>if you have eager unification universe code in a close-to-landing state, I'm for having <a href="https://github.com/rust-lang/rust/issues/54401" target="_blank" title="https://github.com/rust-lang/rust/issues/54401">#54401</a> use it</p>



<a name="134612070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612070">(Sep 25 2018 at 17:05)</a>:</h4>
<p>hmm, I might be able to make it resolve eagerly.</p>



<a name="134612096"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612096" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612096">(Sep 25 2018 at 17:05)</a>:</h4>
<p>of course, if there is no perf impact, and there are no plans for having eager resolve ever, it might be ok to r+ this</p>



<a name="134612118"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612118" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612118">(Sep 25 2018 at 17:05)</a>:</h4>
<p>but I remember that this cache was added to avoid severe perf issues with futures-based code, which definitely has lifetimes</p>



<a name="134612516"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612516" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612516">(Sep 25 2018 at 17:11)</a>:</h4>
<p>I think the code even almost DTRT today</p>



<a name="134612519"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612519" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612519">(Sep 25 2018 at 17:11)</a>:</h4>
<p>given that I get</p>



<a name="134612529"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612529" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612529">(Sep 25 2018 at 17:11)</a>:</h4>
<p>EVAL(Binder(&lt;&amp;ReLateBound(DebruijnIndex(0), BrNamed(crate0:DefIndex(1:12), 'a)) u32 as Foo&gt;))</p>



<a name="134612582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612582">(Sep 25 2018 at 17:12)</a>:</h4>
<p>so it's making the query with an HRTB</p>



<a name="134612826"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612826" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612826">(Sep 25 2018 at 17:16)</a>:</h4>
<p>ah that because impl_or_trait_obligations does a plug_leaks</p>



<a name="134612836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612836">(Sep 25 2018 at 17:17)</a>:</h4>
<p>so maybe we just need to copy the fulfill HRTB obligation logic to select, and everything will work</p>



<a name="134612845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612845">(Sep 25 2018 at 17:17)</a>:</h4>
<p>(tm)</p>



<a name="134612865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134612865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134612865">(Sep 25 2018 at 17:17)</a>:</h4>
<p>*the fulfill Outlives obligation logic</p>



<a name="134629010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134629010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134629010">(Sep 25 2018 at 21:22)</a>:</h4>
<p>BTW, I actually think that evaluation is closer to being a Chalkifiable solver than selection, and that it just intentionally ignores region requirements to have better cacheability properties.</p>



<a name="134629020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134629020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134629020">(Sep 25 2018 at 21:23)</a>:</h4>
<p>*closer to being a Chalkifiable solver than fulfillment</p>



<a name="134629045"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134629045" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134629045">(Sep 25 2018 at 21:23)</a>:</h4>
<p>which is sort of a "perf hack" to handle incremental obligation resolution that goes in parallel with inference.</p>



<a name="134629139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134629139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134629139">(Sep 25 2018 at 21:25)</a>:</h4>
<p>but sure, they are basically "independent" trait solving engines</p>



<a name="134629189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134629189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134629189">(Sep 25 2018 at 21:26)</a>:</h4>
<p>(not quite independent, because fulfillment calls evaluation during winnowing)</p>



<a name="134689984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134689984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134689984">(Sep 26 2018 at 17:19)</a>:</h4>
<p><span class="user-mention" data-user-id="126804">@Ariel Ben-Yehuda</span> so, that PR doesn't seem to regress perf in particular. I think i'd like to land it and then move on with "universe stuff" independently (I'm pushing on my branch some more, though I'm not (yet) doing eager errors — I want to get the lazy errors version working first, since that's the approach I was taking, and then see how I have to adapt it)</p>



<a name="134767863"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767863" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767863">(Sep 27 2018 at 19:19)</a>:</h4>
<p>I am trying to investigate what it takes to make evaluation correct, and it seems to be as easy as I thought it is</p>



<a name="134767879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767879">(Sep 27 2018 at 19:19)</a>:</h4>
<p>I don't think it requires any universe stuff, because of how fulfillment works</p>



<a name="134767918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767918">(Sep 27 2018 at 19:20)</a>:</h4>
<p>what do you mean by correct?</p>



<a name="134767930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767930">(Sep 27 2018 at 19:20)</a>:</h4>
<p>to make it handle things the same way fulfillment does</p>



<a name="134767949"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767949" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767949">(Sep 27 2018 at 19:20)</a>:</h4>
<p>are you planning to propagate back a set of region requirements?</p>



<a name="134767952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767952">(Sep 27 2018 at 19:20)</a>:</h4>
<p>you don't need to</p>



<a name="134767956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767956">(Sep 27 2018 at 19:21)</a>:</h4>
<p>it does most of the things for you anyway with plug_leaks</p>



<a name="134767967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767967">(Sep 27 2018 at 19:21)</a>:</h4>
<p>I guess you're saying: because we only care about this for global predicates?</p>



<a name="134767984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767984">(Sep 27 2018 at 19:21)</a>:</h4>
<p>for "staticized" predicates</p>



<a name="134767985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767985">(Sep 27 2018 at 19:21)</a>:</h4>
<p>yea</p>



<a name="134767988"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767988" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767988">(Sep 27 2018 at 19:21)</a>:</h4>
<p>as in, where all "inference/free" regions are <code>'static</code></p>



<a name="134767990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134767990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134767990">(Sep 27 2018 at 19:21)</a>:</h4>
<p>but evaluation always works staticized</p>



<a name="134768041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768041">(Sep 27 2018 at 19:22)</a>:</h4>
<p>and I think that "classical logic" queries will be staticized for quite some time</p>



<a name="134768044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768044">(Sep 27 2018 at 19:22)</a>:</h4>
<blockquote>
<p>as in, where all "inference/free" regions are <code>'static</code></p>
</blockquote>
<p>I believe this is the condition that <code>is_global</code> checks for, no?</p>



<a name="134768046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768046">(Sep 27 2018 at 19:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span></p>



<a name="134768052"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768052" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768052">(Sep 27 2018 at 19:22)</a>:</h4>
<p>Well you can run evaluation even if your type contains <code>'a</code>, it will just treat the <code>'a</code> as though it was <code>'static</code></p>



<a name="134768055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768055">(Sep 27 2018 at 19:22)</a>:</h4>
<p>(and typeck does that quite a lot of times)</p>



<a name="134768057"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768057" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768057">(Sep 27 2018 at 19:23)</a>:</h4>
<p>yes, I know, but we don't use that to skip fulfill cx work</p>



<a name="134768068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768068">(Sep 27 2018 at 19:23)</a>:</h4>
<p>put another way: I think it would still be a bug if we did, if I understand what you are saying</p>



<a name="134768080"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768080" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768080">(Sep 27 2018 at 19:23)</a>:</h4>
<blockquote>
<p>put another way: I think it would still be a bug if we did, if I understand what you are saying</p>
</blockquote>
<p>sure, but trait matching etc. does use evaluation, so there's no reason for it to be semi-randomly incorrect</p>



<a name="134768134"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768134" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768134">(Sep 27 2018 at 19:24)</a>:</h4>
<p>actually, thinking about it, we might want to return EvaluatedToOk in "intercrate context"</p>



<a name="134768138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768138">(Sep 27 2018 at 19:24)</a>:</h4>
<p>to not allow for extra coherence power</p>



<a name="134768154"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768154" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768154">(Sep 27 2018 at 19:24)</a>:</h4>
<p>I don't see how it can be otherwise if you plan to ignore region obligations?</p>



<a name="134768158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768158">(Sep 27 2018 at 19:24)</a>:</h4>
<p>I still don't understand I guess what def'n of incorrect you are using</p>



<a name="134768173"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768173" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768173">(Sep 27 2018 at 19:25)</a>:</h4>
<p>I mean, trait evaluation should return the correct answer for the staticized version of the query you ask it</p>



<a name="134768181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768181">(Sep 27 2018 at 19:25)</a>:</h4>
<p>if you ask it about <code>&amp;'a Foo: Bar</code>, it should answer the correct answer for <code>&amp;'static Foo: Bar</code></p>



<a name="134768192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768192">(Sep 27 2018 at 19:25)</a>:</h4>
<p>for global types, <code>staticize(T) = T</code>, so you can just do evaluation</p>



<a name="134768202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768202">(Sep 27 2018 at 19:26)</a>:</h4>
<p>ok</p>



<a name="134768273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768273">(Sep 27 2018 at 19:26)</a>:</h4>
<p>seems reasonable</p>



<a name="134768402"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768402" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768402">(Sep 27 2018 at 19:29)</a>:</h4>
<p>so I <em>think</em> I have it working</p>



<a name="134768415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134768415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134768415">(Sep 27 2018 at 19:29)</a>:</h4>
<p>now I'll just try to check it a little to see it solves all the problems</p>



<a name="134991993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134991993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134991993">(Oct 01 2018 at 19:41)</a>:</h4>
<p>Could you review this + <a href="https://github.com/rust-lang/rust/pull/54701" target="_blank" title="https://github.com/rust-lang/rust/pull/54701">https://github.com/rust-lang/rust/pull/54701</a> ? The latter is beta-nominated</p>



<a name="134995483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134995483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134995483">(Oct 01 2018 at 20:43)</a>:</h4>
<p><span class="user-mention" data-user-id="126804">@Ariel Ben-Yehuda</span> yep</p>



<a name="134998635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134998635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134998635">(Oct 01 2018 at 21:46)</a>:</h4>
<p>and what's the status of my PR for <a href="https://github.com/rust-lang/rust/issues/54401" target="_blank" title="https://github.com/rust-lang/rust/issues/54401">#54401</a>? (<a href="https://github.com/rust-lang/rust/issues/54624" target="_blank" title="https://github.com/rust-lang/rust/issues/54624">#54624</a>)?</p>



<a name="134998652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/134998652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ariel Ben-Yehuda <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#134998652">(Oct 01 2018 at 21:46)</a>:</h4>
<p>is it waiting for something?</p>



<a name="135036669"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/issue%20%2354401%20-%20HRTB%20in%20impls%20unsoundness/near/135036669" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/issue.20.2354401.20-.20HRTB.20in.20impls.20unsoundness.html#135036669">(Oct 02 2018 at 13:43)</a>:</h4>
<p>no, I think it's probably good to go, just didn't get to it when doing reviews yesterday I guess. I'll review latest status today</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>